import React, { Component } from 'react'
import UserInfo from './components/UserInfo'
export default class App extends Component {
  constructor(){
    super()
    this.state={
      users:[
        {
          title:'教师信息',
          name:'翟吉喆',
          age:38,
          gender:1,
          hobby:['爱打游戏','爱读书'],
          birthday:new Date(1984,3,8)
        },
        {
          title:'学生信息',
          name:'张资源',
          age:24,
          gender:1,
          hobby:['爱写js','爱UI设计'],
          birthday:new Date(1994,7,24)
        },

        {
          title:'班主任信息',
          name:'王玉倩',
          age:28,
          gender:0,
          hobby:['爱唱歌','爱学习'],
          birthday:new Date(1989,10,18)
        }
      ]
    }
  }
  render() {
    const {users}=this.state
    return (
      <div style={{display:'flex'}}>
         {
            users.map((item,index)=><UserInfo key={index} {...item}/>)
         }
      </div>
    )
  }
}
